﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="modi.aspx.cs" Inherits="orgman_methods_modi" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>编辑</title>
    <link href="../../css/main.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style1
        {
            text-align: center;
        }
        .style2
        {
            font-size: medium;
        }
    </style>
    </head>
<body>   
    <form id="form1" runat="server">
    <div>
        <div id="content" class="boot">
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:appConnectionString %>" 
                DeleteCommand="DELETE FROM [method] WHERE [methodid] = @methodid" 
                InsertCommand="INSERT INTO [method] ([methodname], [creator], [createdtime], [description], [organizationid]) VALUES (@methodname, @creator, @createdtime, @description, @organizationid)" 
                SelectCommand="SELECT * FROM [method] WHERE ([methodid] = @methodid)" 
                UpdateCommand="UPDATE [method] SET [methodname] = @methodname, [description] = @description WHERE [methodid] = @methodid">
                <SelectParameters>
                    <asp:QueryStringParameter Name="methodid" QueryStringField="methodid" 
                        Type="Int32" />
                </SelectParameters>
                <DeleteParameters>
                    <asp:Parameter Name="methodid" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="methodname" Type="String" />
                    <asp:Parameter Name="creator" Type="String" />
                    <asp:Parameter Name="createdtime" Type="DateTime" />
                    <asp:Parameter Name="description" Type="String" />
                    <asp:Parameter Name="organizationid" Type="Int32" />
                    <asp:Parameter Name="methodid" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="methodname" Type="String" />
                    <asp:Parameter Name="creator" Type="String" />
                    <asp:Parameter Name="createdtime" Type="DateTime" />
                    <asp:Parameter Name="description" Type="String" />
                    <asp:Parameter Name="organizationid" Type="Int32" />
                </InsertParameters>
            </asp:SqlDataSource>
            <div class="style1">
                <span class="style2">添加等级尺度</span><br />
            </div>
            <asp:Table ID="Table1" runat="server" Width="700px" CssClass="dataTable">
                <asp:TableRow runat="server">
                    <asp:TableCell runat="server" BorderStyle="None" HorizontalAlign="Center">选项</asp:TableCell>
                    <asp:TableCell runat="server" HorizontalAlign="Center">*等级名称</asp:TableCell>
                    <asp:TableCell runat="server" HorizontalAlign="Center">*相应评语</asp:TableCell>
                    <asp:TableCell runat="server" HorizontalAlign="Center">*分值（1-...）</asp:TableCell>
                </asp:TableRow>
            </asp:Table>
            <table width="700">
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        <asp:Image ID="Image3" runat="server" ImageUrl="~/images/101.png" />
                        <asp:LinkButton ID="LinkButton2" runat="server" onclick="LinkButton2_Click">增加选项</asp:LinkButton>
                    </td>
                    <td align="center">
                        <asp:ImageButton ID="ImageButton1" runat="server" 
                            ImageUrl="~/images/submit.gif" onclick="ImageButton1_Click" />
                        <asp:Label ID="Label2" runat="server"></asp:Label>
                    </td>
                    <td style="text-align: right">
                            <asp:Image ID="Image2" runat="server" ImageUrl="~/images/1.png" />
                        <asp:LinkButton ID="LinkButton3" runat="server" onclick="LinkButton3_Click">减少选项</asp:LinkButton>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        可分多次添加</td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>
            <hr style="color: #3399FF" />
            <div align="left">当前评估方法：</div>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                DataKeyNames="methodid" DataSourceID="SqlDataSource1" 
                Width="700px" PageSize="1" 
                CssClass="dataTable">
                <Columns>
                    <asp:BoundField DataField="methodname" HeaderText="方法名称" 
                        SortExpression="methodname" ItemStyle-Width="100px" >
<ItemStyle Width="120px"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="creator" HeaderText="创建者" 
                        SortExpression="creator" ReadOnly="True" ItemStyle-Width="70px" >
<ItemStyle Width="80px"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="createdtime" HeaderText="创建时间" 
                        SortExpression="createdtime" ReadOnly="True" ItemStyle-Width="120px" >
<ItemStyle Width="150px"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="description" HeaderText="描述" 
                        SortExpression="description" />
                    <asp:CommandField ShowEditButton="True" 
                        EditText="&lt;font color='red'&gt;编辑内容&lt;/font&gt;" 
                        ItemStyle-Width="70px" >
<ItemStyle Width="70px"></ItemStyle>
                    </asp:CommandField>
                </Columns>
            </asp:GridView>
            <hr style="color: #3399FF" />
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                ConnectionString="<%$ ConnectionStrings:appConnectionString %>" 
                DeleteCommand="DELETE FROM [level] WHERE [levelid] = @levelid" 
                InsertCommand="INSERT INTO level(levelname, judgement, methodid, levelvalue) VALUES (@levelname, @judgement, @methodid, @levelvalue)" 
                SelectCommand="SELECT * FROM [level] WHERE ([methodid] = @methodid)" 
                
                UpdateCommand="UPDATE level SET levelname = @levelname, judgement = @judgement, levelvalue = @levelvalue WHERE (levelid = @levelid)">
                <SelectParameters>
                    <asp:QueryStringParameter Name="methodid" QueryStringField="methodid" 
                        Type="Int32" />
                </SelectParameters>
                <DeleteParameters>
                    <asp:Parameter Name="levelid" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="levelname" Type="String" />
                    <asp:Parameter Name="judgement" Type="String" />
                    <asp:Parameter Name="methodid" Type="Int32" />
                    <asp:Parameter Name="levelvalue" Type="Single" />
                    <asp:Parameter Name="levelid" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="levelname" Type="String" />
                    <asp:Parameter Name="judgement" Type="String" />
                    <asp:Parameter Name="methodid" Type="Int32" />
                    <asp:Parameter Name="levelvalue" Type="Single" />
                </InsertParameters>
            </asp:SqlDataSource>
            <div align="left">现有的等级尺度如下：</div>
            <div style="width: 700px">
            <asp:ListView ID="ListView1" runat="server" DataKeyNames="levelid" 
                DataSourceID="SqlDataSource2">
                <AlternatingItemTemplate>
                    <tr style="" class="dataTable">
                        <td width="160px">
                            <asp:LinkButton ID="DeleteLinkButton" runat="server" CommandName="Delete" Text="删除">
                            <img src='../../images/delete.gif' alt='删除'/></asp:LinkButton>
                            <asp:LinkButton ID="EditLinkButton" runat="server" CommandName="Edit" Text="编辑">
                            <img src='../../images/modify...gif' alt='编辑'/></asp:LinkButton>
                        </td>
                        <td>
                            <asp:Label ID="levelidLabel" runat="server" Text='<%# Eval("levelid") %>' Visible="false" />
                        </td>
                        <td>
                            <asp:Label ID="levelnameLabel" runat="server" Text='<%# Eval("levelname") %>' />
                        </td>
                        <td>
                            <asp:Label ID="judgementLabel" runat="server" Text='<%# Eval("judgement") %>' />
                        </td>
                        <td>
                            <asp:Label ID="methodidLabel" runat="server" Text='<%# Eval("methodid") %>' Visible="false" />
                        </td>
                        <td>
                            <asp:Label ID="levelvalueLabel" runat="server" Text='<%# Eval("levelvalue") %>' />
                        </td>
                    </tr>
                </AlternatingItemTemplate>
                <LayoutTemplate>
                    <table runat="server" width="100%" class="dataTable">
                        <tr runat="server">
                            <td runat="server">
                                <table ID="itemPlaceholderContainer" runat="server" border="0" 
                                    style=" width:100%;">
                                    <tr runat="server" style=" color:White; background-color:#5d7b9d">
                                        <th runat="server">
                                        </th>
                                        <th runat="server">
                                            等级ID</th>
                                        <th runat="server">
                                            等级名称</th>
                                        <th runat="server">
                                            对应的评语</th>
                                        <th runat="server">
                                            所属方法ID</th>
                                        <th id="Th1" runat="server">
                                            分值</th>
                                    </tr>
                                    <tr ID="itemPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr runat="server">
                            <td runat="server" 
                                style="">
                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
                <InsertItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="插入" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="清除" />
                        </td>
                        <td>
                            &nbsp;</td>
                        <td>
                            <asp:TextBox ID="levelnameTextBox" runat="server" 
                                Text='<%# Bind("levelname") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="judgementTextBox" runat="server" 
                                Text='<%# Bind("judgement") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="methodidTextBox" runat="server" 
                                Text='<%# Bind("methodid") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="levelvalueTextBox" runat="server" 
                                Text='<%# Bind("levelvalue") %>' />
                        </td>
                    </tr>
                </InsertItemTemplate>
                <SelectedItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="删除" />
                            <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="编辑" />
                        </td>
                        <td>
                            <asp:Label ID="levelidLabel" runat="server" Text='<%# Eval("levelid") %>' />
                        </td>
                        <td>
                            <asp:Label ID="levelnameLabel" runat="server" Text='<%# Eval("levelname") %>' />
                        </td>
                        <td>
                            <asp:Label ID="judgementLabel" runat="server" Text='<%# Eval("judgement") %>' />
                        </td>
                        <td>
                            <asp:Label ID="methodidLabel" runat="server" Text='<%# Eval("methodid") %>' />
                        </td>
                        <td>
                            <asp:Label ID="levelvalueLabel" runat="server" Text='<%# Eval("levelvalue") %>' />
                        </td>
                    </tr>
                </SelectedItemTemplate>
                <EmptyDataTemplate>
                    <table runat="server" 
                        style="">
                        <tr>
                            <td>
                                <asp:Label ID="Label1" runat="server" Text="您当前的评价方法还没有任何等级数据。" ForeColor="Red"></asp:Label></td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <EditItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="更新" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="取消" />
                        </td>
                        <td>
                            <asp:Label ID="levelidLabel1" runat="server" Text='<%# Eval("levelid") %>' Visible="false" />
                        </td>
                        <td>
                            <asp:TextBox ID="levelnameTextBox" runat="server" 
                                Text='<%# Bind("levelname") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="judgementTextBox" runat="server" 
                                Text='<%# Bind("judgement") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="methodidTextBox" runat="server" 
                                Text='<%# Bind("methodid") %>' ReadOnly="true" Visible="false" />
                        </td>
                        <td>
                            
                            <asp:TextBox ID="levelTextBox" runat="server" 
                                Text='<%# Bind("levelvalue") %>' />
                        </td>
                    </tr>
                </EditItemTemplate>
                <ItemTemplate>
                    <tr style="" class="dataTable">
                        <td>
                            <asp:LinkButton ID="DeleteLinkButton" runat="server" CommandName="Delete" Text="删除">
                            <img src='../../images/delete.gif' alt='删除'/></asp:LinkButton>
                            <asp:LinkButton ID="EditLinkButton" runat="server" CommandName="Edit" Text="编辑">
                            <img src='../../images/modify...gif' alt='编辑'/></asp:LinkButton>
                        </td>
                        <td>
                            <asp:Label ID="levelidLabel" runat="server" Text='<%# Eval("levelid") %>' Visible="false" />
                        </td>
                        <td>
                            <asp:Label ID="levelnameLabel" runat="server" Text='<%# Eval("levelname") %>' />
                        </td>
                        <td>
                            <asp:Label ID="judgementLabel" runat="server" Text='<%# Eval("judgement") %>' />
                        </td>
                        <td>
                            <asp:Label ID="methodidLabel" runat="server" Text='<%# Eval("methodid") %>' Visible="false" />
                        </td>
                        <td>
                            <asp:Label ID="levelvalueLabel" runat="server" Text='<%# Eval("levelvalue") %>' />
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:ListView>
            </div>
            </div>
    </div>
    </form>
</body>
</html>
